package com.cbts.entity;

import java.util.Date;
import javax.persistence.AttributeOverride;
import javax.persistence.AttributeOverrides;
import javax.persistence.Column;
import javax.persistence.EmbeddedId;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.Table;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;

/**
 * DepartmentQuarterReport entity. @author MyEclipse Persistence Tools
 */
@Entity
@Table(name = "department_quarter_report", catalog = "cbts")
public class DepartmentQuarterReport implements java.io.Serializable {

	// Fields

	private DepartmentQuarterReportId id;
	private Department department;
	private Date alterDate;
	private Double allPreAmount;
	private Double allAppAmount;
	private Double saveAmount;

	// Constructors

	/** default constructor */
	public DepartmentQuarterReport() {
		allPreAmount=0.00;
		allAppAmount=0.00;
		saveAmount=0.00;
	}

	/** full constructor */
	public DepartmentQuarterReport(DepartmentQuarterReportId id,
			Department department, Date alterDate, Double allPreAmount,
			Double allAppAmount, Double saveAmount) {
		this.id = id;
		this.department = department;
		this.alterDate = alterDate;
		this.allPreAmount = allPreAmount;
		this.allAppAmount = allAppAmount;
		this.saveAmount = saveAmount;
	}

	// Property accessors
	@EmbeddedId
	@AttributeOverrides({
			@AttributeOverride(name = "quarters", column = @Column(name = "quarters", nullable = false, length = 6)),
			@AttributeOverride(name = "departmentId", column = @Column(name = "departmentId", nullable = false, length = 11)) })
	public DepartmentQuarterReportId getId() {
		return this.id;
	}

	public void setId(DepartmentQuarterReportId id) {
		this.id = id;
	}

	@ManyToOne(fetch = FetchType.LAZY)
	@JoinColumn(name = "departmentId", nullable = false, insertable = false, updatable = false)
	public Department getDepartment() {
		return this.department;
	}

	public void setDepartment(Department department) {
		this.department = department;
	}

	@Temporal(TemporalType.DATE)
	@Column(name = "alterDate", nullable = false, length = 10)
	public Date getAlterDate() {
		return this.alterDate;
	}

	public void setAlterDate(Date alterDate) {
		this.alterDate = new Date(alterDate.getTime());
	}

	@Column(name = "allPreAmount", nullable = false, precision = 11)
	public Double getAllPreAmount() {
		return this.allPreAmount;
	}

	public void setAllPreAmount(Double allPreAmount) {
		this.allPreAmount = allPreAmount;
	}

	@Column(name = "allAppAmount", nullable = false, precision = 11)
	public Double getAllAppAmount() {
		return this.allAppAmount;
	}

	public void setAllAppAmount(Double allAppAmount) {
		this.allAppAmount = allAppAmount;
	}

	@Column(name = "saveAmount", nullable = false, precision = 11)
	public Double getSaveAmount() {
		return this.saveAmount;
	}

	public void setSaveAmount(Double saveAmount) {
		this.saveAmount = saveAmount;
	}

}